import request from '@/utils/request'

export default {
  role(page, limit, roleName = '') {
    return request.get(`/admin/acl/role/${page}/${limit}?roleName=${roleName}`)
  },
  toAssign(roleId) {
    return request.get(`/admin/acl/permission/toAssign/${roleId}`)
  },
  remove(roleId) {
    return request.delete(`/admin/acl/role/remove/${roleId}`)
  },
  update(role) {
    return request.put('/admin/acl/role/update', role)
  },
  save(roleName) {
    return request.post('/admin/acl/role/save', roleName)
  },
  batchRemove(roleIdList) {
    return request.delete('/admin/acl/role/batchRemove', roleIdList)
  },
  doAssign(roleId, permissionId) {
    return request.post(`/admin/acl/permission/doAssign?roleId=${roleId}&permissionId=${permissionId}`)
  }
}